﻿using Microsoft.AspNetCore.Mvc;
using Tauren.Business.Entity.Input;
using Tauren.Business.Infrastructure.Common;
using Tauren.Business.Service.LogIns;

namespace Tauren.Business.Core.Controllers
{
    /// <summary>
    /// 用户登录
    /// </summary>
    [Route("api/[controller]"), ApiVersion("1.0")]
    [ApiController]
    public class LogInController : ControllerBase
    {
        private ILogInService service { get; set; }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="_service"></param>
        public LogInController(ILogInService _service)
        {
            service = _service;
        }

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="logInModel"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult LogIn([FromBody] LogInModel logInModel) => service.LogIn(logInModel).ToJsonResult();
    }
}
